﻿@inject BaseWebElement _baseWebElement;
@inject SqlContext _sqlcontext;
@model ContentClass
@{
    int classId = (int)ViewData["ClassId"];
    int page = (int)ViewData["page"];
    var CurrentlanguageclassHref = _baseWebElement.GetCurrentlanguageclassHref();
    var url = CurrentlanguageclassHref+"news";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var CompanyName = _baseWebElement.GetWebElement(WebElementType.CompanyName)?.Value;
    var LocationClass = _baseWebElement.GetCurrentRoute(Model.Id);
    ViewData["Title"] = Model.ClassName + " - " + CompanyName;
    var NewsPage = _sqlcontext.QueryPageList<News_Info>(classId == 0 ? (m => m.LanguageId == _baseWebElement.Currentlanguage.Id) : (m => m.ClassId == classId), "Id desc", page, 6);
    ViewData["keywords"] = Model.SeoKeywords;
    ViewData["description"] = Model.SeoDescritions;
}
<div class="wrapper">
    <div class="crumbs">
        <div class="container">
            <p class="weizhi">
                @(_baseWebElement.QueryLanText("Location"))：<a href="@(CurrentlanguageclassHref)">@(_baseWebElement.QueryLanText("Home"))</a>
                @if (LocationClass != null && LocationClass.Count > 0)
                {
                    foreach (var item in LocationClass)
                    {
                        @Html.Raw("&gt")<a href="@(item.ClassHref)">@item.ClassName</a>
                    }
                }
            </p>
        </div>
    </div>
    <div class="newsBox">
        <div class="container">
            @foreach (var item in NewsPage.data)
            {
                <div class="newsLi">
                    <a href="@(CurrentlanguageclassHref)news/detail/@(item.Id).html">@item.Title</a>
                    <h5>@(item.NewsTime.ToDateTime().Value.ToString("yyyy/MM/dd"))</h5>
                    <p>@(item.Content.StripHtml(25))</p>
                </div>
            }
            <div class="fw-pagination-box divide">
                @Html.Raw(PagingHelper.PagingRaw((int)NewsPage.count, NewsPage.PageSize, page, url, 9))
            </div>

        </div>
    </div>
</div>
